package com.firmboy.proxy.jdk.demo1;

import java.lang.reflect.Proxy;

/**
 * @author firmboy
 * @create 2018-06-19 下午1:10
 **/
public class ProxyFactory {

    private Object target;

    public ProxyFactory(Object target){
        this.target = target;
    }


    public Object getProxy(){

        return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),target.getClass().getInterfaces(),new MyInvocationHandler(target));

    }

}
